<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<script type="text/javascript" src="plug-in/jquery/jquery-1.8.3.js"></script>
<link rel="stylesheet" type="text/css" href="webpage/com/recruit/user/css/main.html_aio_be38d0a.css" />
</head>
<body>
<!-- 页面主体START -->
<header class="sso_header">
</header>
<section class="content_box cleafix">
    <h2>找工作 <i>|</i> <span>专注互联网职业机会</span><a href="/jeecg" data-lg-tj-id="1Ur0" data-lg-tj-no="idnull" data-lg-tj-cid="idnull">我要招人</a></h2>
    <div class="left_area fl">
        <form action="userLoginContoller.do?doRegister" method="">
            <div class="form_body"  data-view="phoneRegister">
                <div class="input_item clearfix" data-propertyname="phone" data-controltype="Phone">
                    <span>账号：</span>
                    <input type="text" class="input" id="userName" name="" placeholder="请输入账号" data-required="required" autocomplete="off" >
                   	<span>密码：</span>
                    <input type="text" class="input" id="password" name="" placeholder="请输入账号" data-required="required" autocomplete="off" >
                </div>
                <div class="input_item btn_group clearfix" data-propertyname="submit" data-controltype="Botton">
                    <input type="button" class="btn btn_green btn_active btn_block btn_lg" value="注&nbsp;册" onclick="register()">
                </div>
            </div>
        </form>
    </div>
    <div class="divider fl"></div>
    <div class="right_area fl">
        <h5>已有帐号:</h5>
        <a href="userLoginContoller.do?toLogin" class="login_now" data-lg-tj-id="18N0" data-lg-tj-no="idnull" data-lg-tj-cid="idnull">直接登录</a>
    </div>
</section>

<script type="text/javascript">

	function register(){
		var username = $("#userName").val();
		var password = $("#password").val();
		if(username == ""){
			alert("账号不能为空");
		}else{
			if(password == ""){
				alert("密码不能为空")
			}else{
				$.ajax({
					  type: 'POST',
					  url: 'userLoginContoller.do?doRegister',
					  data: {
							userName:username,
							password:password
						},
					  success: function(res){
						  if(res == 1){
							  if(confirm("注册成功，跳转到登录页面")){
								  window.location.href = 'userLoginContoller.do?toLogin';
							  }
						  }else{
							  if(res == 0) alert("账号被注册")
						  }
					  }
					});
			}
		}
	}


</script>

</body>
</html>